package cn.bluemobi.platform.controller.system;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import cn.bluemobi.common.core.dto.MapDto;
import cn.bluemobi.platform.core.controller.PlatformBaseController;
import cn.bluemobi.platform.entity.system.SystemSetting;
import cn.bluemobi.platform.service.SystemSettingService;

/**
 * 
 * @author lvxh
 * 
 */
@Controller
@RequestMapping("/admin/systemSetting")
public class SystemSettingController extends PlatformBaseController {

	@Autowired
	private SystemSettingService systemSettingService;

	@RequestMapping("/toSystemSettingDetailPage")
	public String toSystemSettingDetailPage(ModelMap model) {
		SystemSetting systemSetting = systemSettingService
				.findSystemSettingDetail();
		model.put("systemSetting", systemSetting);
		return "system/systemSetting";
	}

	@RequestMapping("/saveSystemSetting")
	@ResponseBody
	public MapDto saveSystemSetting(SystemSetting systemSetting) {
		return systemSettingService.saveOrUpdate(systemSetting, getUser());
	}

}
